import 'package:flutter/material.dart';
import 'package:flutter_aggregate/model/onlineOrder/constants.dart';
import 'package:flutter_svg/flutter_svg.dart';

class OnlineSearchBox extends StatelessWidget {
  const OnlineSearchBox({
    Key? key, 
    required this.onChange,
  }) : super(key: key);

  final ValueChanged<String> onChange;

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.all(20),
      padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 5),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(50),
        border: Border.all(
          color: onlineOrderKSecondaryColor.withOpacity(.32)
        )
      ),
      child: TextField(
        onChanged: onChange,
        decoration: InputDecoration(
          border: InputBorder.none,
          icon: SvgPicture.asset('assets/online/icons/search.svg'),
          hintText: 'Search Here',
          hintStyle: const TextStyle(
            color: onlineOrderKSecondaryColor
          )
        ),
      ),
    );
  }
}